//
//  LFcertainView.m
//  LoveFruit
//
//  Created by mac on 16/9/25.
//  Copyright © 2016年 张令林. All rights reserved.
//

#import "LFcertainView.h"



@implementation LFcertainView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
     [self setupUI];
    }
    return self;
}


- (void)setupUI {
    

    UILabel *moneyLabel = [UILabel labelWithText:@"金额" andTextColor:[UIColor redColor] andFontSize:12];
   
    [self addSubview:moneyLabel];
    
    [moneyLabel mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.left.offset(30);
        make.centerY.equalTo(self);
    }];
    self.money = moneyLabel;
    
    UIButton *certainButton = [UIButton buttonLRWithImgName:nil title:@"选好了" color:[UIColor blackColor] forSize:18 target:self action:@selector(certainBtnClick) forControlEvents:UIControlEventTouchUpInside];
    
    [certainButton setBackgroundImage:[UIImage imageNamed:@"v2_coupon_verify_normal"] forState:UIControlStateNormal];
    [certainButton setBackgroundImage:[UIImage imageNamed:@"v2_coupon_verify_normal"] forState:UIControlStateSelected];
    
    [certainButton setTitleColor:[UIColor darkGrayColor] forState:UIControlStateSelected];
    
    [self addSubview:certainButton];
    
    [certainButton mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.right.top.bottom.equalTo(self);
        make.width.offset(100);
    
    }];
    self.certain = certainButton;
}

- (void)certainBtnClick {

    if ([self.delegate respondsToSelector:@selector(certainView:)]) {
        
        [self.delegate certainView:self];
    }
}
@end
